<#assign classNameLower = ClassName ? uncap_first>
package ${pPackage}.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import ${pPackage}.util.IdWorker;

import java.util.List;

/**
 * 这里分页使用的是pagehelper
 */
@Service
@Transactional(readOnly = false)
public class ${ClassName}ServiceImpl implements ${ClassName}Service {

    @Autowired
    private IdWorker idWorker;

    @Autowired
    private ${ClassName}Dao ${classNameLower}Dao;

    @Override
    public List<${ClassName}> findAll(int page, int size, String query) {
        List<${ClassName}> list = ${classNameLower}Service.selectList(null);
        return list;
    }

    @Override
    public ${ClassName} findById(String id) {
        ${ClassName} ${classNameLower} = ${classNameLower}Service.findById(id);
        return ${classNameLower};
    }

    @Override
    public void insert(${ClassName} ${classNameLower}) {
        ${classNameLower}Dao.insert(${classNameLower});
    }

    @Override
    public void update(${ClassName} ${classNameLower}) {
        ${classNameLower}Dao.updateById(${classNameLower});
    }

    @Override
    public void deleteById(String id) {
        ${classNameLower}Dao.deleteById(id);
    }
}